import request from '@/utils/request'

export function Menu(data, method, id) {
  id = id ? `/${id}` : ''
  return request({
    url: `/Menu${id}`,
    method: method,
    data
  })
}

export function MenuDetail(data) {
  return request({
    url: `/Menu/` + data.id,
    method: 'GET'
  })
}

export function MenuAll(params) {
  return request({
    url: '/Menu/AllMenus',
    method: 'get',
    params
  })
}
export function MenuAll2(params) {
  return request({
    url: '/Menu/AllMenus2',
    method: 'get',
    params
  })
}
export function MenuAllWithRole(params) {
  return request({
    url: '/Menu/AllMenusWithRole',
    method: 'get',
    params
  })
}
export function AllMenusWithRoleFront(params) {
  return request({
    url: '/Menu/AllMenusWithRoleFront',
    method: 'get',
    params
  })
}
// 获取某工点所有用户
export function GetEmployeesByCode(value) {
  return request({
    url: '/Menu/GetEmployeesByCode',
    method: 'GET',
    params: {
      tenantCode: value
    }
  })
}
// 获取菜单
export function MenuSearch(data) {
  return request({
    url: '/Menu/Search',
    method: 'post',
    data
  })
}

export function MenuBatch(data) {
  return request({
    url: '/Menu/Batch',
    method: 'post',
    data
  })
}

export function ImportEmployee(data) {
  return request({
    url: '/Menu/ImportEmployee',
    method: 'post',
    data
  })
}
